---
title: SAIF.Services.Export architecture
summary: Architectural responsibilities, boundaries, and interaction patterns.
status: draft
owner: <owner>
last_reviewed: 2026-08-21
library: SAIF.Services.Export
reference_type: embedded
---

# SAIF.Services.Export architecture

`SAIF.Services.Export` is a small, stateless .NET Framework 4.6.2 class library that provides a single generic utility — converting an in-memory collection into delimited (CSV-style) text — for consumption by the `Legal` front-end web application.*

## Responsibilities
- Convert any `IEnumerable(Of T)` collection into a delimited text string (CSV by default), using reflection to enumerate the public properties of `T` for both the header row and each data row.
- Support configurable delimiter and quoting behavior via optional `Delimiter` and `UseQuotes` parameters.

## Component boundaries
- `ExportServices` (public class, single type in the library): owns the entire export-formatting responsibility. It is generic and reflection-driven, with no knowledge of specific business entities.*
- The library has no other components — it is a single class with a single public method (`GetCSV(Of T)`).

## Interaction model
- A caller (presumed to be a Legal web page or code-behind) obtains a populated collection of business/DTO objects, invokes `ExportServices.GetCSV(Of T)`, and receives a `String` result it can stream back to the browser (e.g., as a file download).*
- The library performs no outbound calls to other SAIF libraries, no database access, and no security/authorization checks — those concerns remain the caller's responsibility.
- It sits outside the SAIF BOF business-object layered architecture (no `IBusinessCriteria`, no `IDataPortalInfo`, no database access); it is a pure in-memory formatting helper, not a data-access or business-rule layer.*

## Design constraints
- Reflection-based property enumeration (`System.ComponentModel.TypeDescriptor` / `PropertyDescriptorCollection`) means the shape of `T` is discovered dynamically at runtime rather than declared statically.
- Null property values are silently skipped during row construction rather than emitted as empty placeholders, which can misalign column counts across rows when null values occur mid-row.*
- The library declares several unused BCL references/imports (`System`, `System.Data`, `System.Xml`, `System.Core`, `System.Xml.Linq`, `System.Data.DataSetExtensions`) that appear to be vestigial defaults from the VB class-library project template rather than active dependencies.*

## Architecture diagram
The following diagram shows the library's single component and its relationship to its sole known consumer.

```mermaid
flowchart TD
	A["Legal web application<br>(caller)"] --> B["ExportServices.GetCSV(Of T)<br>(SAIF.Services.Export)"]
	B --> C["System.ComponentModel.TypeDescriptor<br>(BCL reflection)"]
	B --> D["System.Text.StringBuilder<br>(BCL)"]
```

## Sequence diagram
The following diagram shows the primary request/response sequence when a caller requests a delimited export.

```mermaid
sequenceDiagram
	participant Client as Legal web page/code-behind
	participant Service as ExportServices.GetCSV(Of T)
	participant Reflection as TypeDescriptor (BCL)
	Client->>Service: GetCSV(collection, Delimiter, UseQuotes)
	Service->>Reflection: GetProperties(first item of T)
	Reflection-->>Service: PropertyDescriptorCollection
	Service->>Service: Build header row and data rows via StringBuilder
	Service-->>Client: Delimited text string
```

## Related documentation
- [Index](index.md)
- [Overview](overview.md)
- [Dependencies](dependencies.md)
- [Operations and processes](operations-processes.md)
- [Business rules](business-rules.md)
- [Configuration](configuration.md)
- [API reference](api/index.md)

> **Note:** Statements marked with * were inferred from code structure, naming conventions, or
> contextual evidence where direct confirmation was not available in source artifacts. Statements
> marked with ** could not be confirmed; treat as unknown until verified.

## Sources
- `SAIF.Services.Export\ExportServices.vb`
- `SAIF.Services.Export\SAIF.Services.Export.vbproj`
- `.saifdocgen\state\runs\20260821-113120-claims-bof-web-legal\analysis\TSK009-analysis.md`
